weather_df =
rnoaa::meteo_pull_monitors(c("USW00094728", "USC00519397", "USS0023B17S"),
var = c("PRCP", "TMIN", "TMAX"),
date_min = "2017-01-01",
date_max = "2017-12-31") %>%
mutate(
name = recode(id, USW00094728 = "CentralPark_NY",
USC00519397 = "Waikiki_HA",
USS0023B17S = "Waterhole_WA"),
tmin = tmin / 10,
tmax = tmax / 10,
month = lubridate::floor_date(date, unit = "month")) %>%
select(name, id, date, month, everything())
Column
Chart A
weather_df %>%
mutate(text_label = str_c("tmax: ", tmax, "\ntmin: ", tmin)) %>%
plot_ly(
x = ~tmax, y = ~tmin, type = "scatter", mode = "markers",
color = ~name, text = ~text_label, alpha = 0.5)
## Warning: Ignoring 15 observations
Column
Chart B
weather_df %>%
mutate(text_label = str_c("tmax: ", tmax, "\ntmin: ", tmin)) %>%
plot_ly(
y = ~tmax, color = ~name, type = "box",colors = "Set1")
## Warning: Ignoring 3 observations
Chart C
weather_df %>%
filter((tmax-tmin) > 10) %>%
count(name) %>%
plot_ly(x = ~name, y = ~n, color = ~name, type = "bar")